package com.vertigrated.db.mssql;

import com.vertigrated.db.AbstractSelectBuilder;
import com.vertigrated.temporal.Date;

import java.text.SimpleDateFormat;

class SelectBuilder extends AbstractSelectBuilder
{
    SelectBuilder(final String tableName)
    {
        super(null, tableName);
    }

    SelectBuilder(String schemaName, String tableName)
    {
        super(schemaName, tableName);
    }

    SelectBuilder(final String schemaName, final String tableName, final Database.DateTimeFormat dateFormat)
    {
        super(schemaName, tableName);
    }

    public void addColumnName(final String name, final String isNull)
    {
        super.addColumnNameAliasWithIsNull(name, null, "ISNULL", isNull, true);
    }

    public void addColumnName(final String name, final String alias, final String isNull)
    {
        super.addColumnNameAliasWithIsNull(name, alias, "ISNULL", isNull, true);
    }

    public void addColumnName(final String name, final Number isNull)
    {
        super.addColumnNameAliasWithIsNull(name, null, "ISNULL", isNull.toString(), false);
    }

    public void addColumnName(final String name, final String alias, final Number isNull)
    {
        super.addColumnNameAliasWithIsNull(name, alias, "ISNULL", isNull.toString(), false);
    }

    public void addColumnName(final String name, final Date isNull)
    {
        this.addColumnName(name, null, isNull);
    }

    public void addColumnName(final String name, final String alias, final Date isNull)
    {
        super.addColumnNameAliasWithIsNull(name, alias, "ISNULL", isNull.toString(), true);
    }
}
